home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / AGNUS / INC / CPX.H
Encoding:
C/C++ Source or Header  |  1997-10-04  |  4.9 KB  |  159 lines

  1. /*
  2.  * cpx.h - cpx structures
  3.  *
  4.  * Copyright (c) 1991 HiSoft
  5.  * adaptation for GNU C/C++: Volker Hemsen, 10/1997
  6.  *
  7.  * structures: MRETS MOBLK XCPB CPXINFO CPXHEAD
  8.  */
  9.  
  10. #ifndef CPX_H
  11. #define CPX_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. #ifdef __GNUC__
  17. #define __stdargs
  18. #define __saveds
  19. #include <gemfast.h>
  20. #else
  21. #include <aes.h>
  22. #endif
  23.  
  24. /*
  25.  *    for XControl:
  26.  *        object tree: 256*176
  27.  *        CPXINFO* cpx_init(XCPB* xcpb)
  28.  *
  29.  *  Option for COPS:
  30.  *        object tree: 512*384 maximum
  31.  *        CPXINFO* cpx_init(XCPB *xcpb,long magic,long version);
  32.  */
  33.  
  34. #ifdef _COPS_
  35. short is_COPS(long magic,long version)
  36. {
  37. #define COPS_MAGIC 0x434F5053
  38.     if ((magic==COPS_MAGIC)&&(version>=0x10000L)) /* COPS? */
  39.         return(1);
  40.     return( 0 );                                 /* XCONTROL */
  41. }
  42. #endif
  43.  
  44. /******************************************************************/
  45. /*****************  XCPB: XControl parameter block  ***************/
  46. /*****************  XControl -> cpx-modul           ***************/
  47. /******************************************************************/
  48. typedef struct moblk
  49. {
  50.     short m_out;
  51.     short m_x;
  52.     short m_y;
  53.     short m_w;
  54.     short m_h;
  55. } MOBLK;
  56. typedef struct _xcpb
  57. {
  58.     short handle;
  59.     short booting;
  60.     short version;
  61.     short SkipRshFix;
  62.     char *reserve1;
  63.     char *reserve2;
  64.     void (* __stdargs rsh_fix)(short,short,short,short,OBJECT *,TEDINFO *,
  65.       char *,ICONBLK *,BITBLK *,long *,long *,long *,void *);
  66.     void (* __stdargs rsh_obfix)(OBJECT *,short);
  67.     short (* __stdargs Popup)(char *[],short,short,short,GRECT *, GRECT *);
  68.     void (* __stdargs Sl_size)(OBJECT *,short,short,short,short,short,short);
  69.     void (* __stdargs Sl_x)(OBJECT *,short,short,short,short,short,void (* __saveds)(void));
  70.     void (* __stdargs Sl_y)(OBJECT *,short,short,short,short,short,void (* __saveds)(void));
  71.     void (* __stdargs Sl_arrow)(OBJECT *,short,short,short,short,short,short,short *,short,void (* __saveds)(void));
  72.     void (* __stdargs Sl_dragx)(OBJECT *,short,short,short,short,short *,void (* __saveds)(void));
  73.     void (* __stdargs Sl_dragy)(OBJECT *,short,short,short,short,short *,void (* __saveds)(void));
  74.     short (* __stdargs Xform_do)(OBJECT *,short,short *);
  75.     GRECT *(* __stdargs GetFirstRect)(GRECT *);
  76.     GRECT *(* __stdargs GetNextRext)(void);
  77.     void (* __stdargs Set_Evnt_Mask)(short,MOBLK *,MOBLK *,long);
  78. #define SAVE_DEFAULTS    0
  79. #define MEM_ERR        1
  80. #define FILE_ERR    2
  81. #define FILE_NOT_FOUND    3
  82.     short (* __stdargs XGen_Alert)(short);
  83.     short (* __stdargs CPX_Save)(void *,long);
  84.     void *(* __stdargs Get_Buffer)(void);
  85.     short (* __stdargs getcookie)(long cookie,long *p_value);
  86.     short Country_Code;
  87. #define MFSAVE    1
  88. #define MFRESTORE    0
  89.     void (* __stdargs MFsave)(short saveit,MFORM *mf);
  90. } XCPB;
  91.  
  92. /******************************************************************/
  93. /*****************  CPXINFO: cpx-modul -> XControl  ***************/
  94. /******************************************************************/
  95. typedef struct
  96. {
  97.     short x;
  98.     short y;
  99.     short buttons;
  100.     short kstate;
  101. } MRETS;
  102. typedef struct _cpxinfo
  103. {
  104. #ifndef _COPS_
  105.     short (* __saveds __stdargs cpx_call)(GRECT *);
  106. #else
  107.     short (* __saveds __stdargs cpx_call)(GRECT *, DIALOG *);
  108. #endif
  109.     void (* __saveds __stdargs cpx_draw)(GRECT *);
  110.     void (* __saveds __stdargs cpx_wmove)(GRECT *);
  111.     void (* __saveds __stdargs cpx_timer)(short *);
  112.     void (* __saveds __stdargs cpx_key)(short,short,short *);
  113.     void (* __saveds __stdargs cpx_button)(MRETS *,short,short *);
  114.     void (* __saveds __stdargs cpx_m1)(MRETS *,short *);
  115.     void (* __saveds __stdargs cpx_m2)(MRETS *mrets,short *);
  116.     short (* __saveds __stdargs cpx_hook)(short,short *,MRETS *,short *,short *);
  117.     void (* __saveds __stdargs cpx_close)(short);
  118. } CPXINFO;
  119.  
  120. /******************************************************************/
  121. /*************************** CPX header ***************************/
  122. /******************************************************************/
  123. typedef struct _cpxhead
  124. {
  125. #define CPXMAGIC    100            /* magic number */
  126.     unsigned short magic;
  127.     struct
  128.     {
  129.         unsigned reserved    :    13;
  130.         unsigned resident    :    1;    /* RAM resident flag */
  131.         unsigned bootinit    :    1;    /* boot initialization flag */
  132.         unsigned setonly    :    1;    /* set only CPX flag */
  133.     } flags;
  134.     long cpx_id;                /* CPX ID value */
  135.     unsigned short cpx_version;    /* CPX version number */
  136.     char i_text[14];            /* icon text */
  137.     unsigned short sm_icon[48];    /* icon bitmap - 32x24 pixels */
  138.     struct {                    /* icon colour */
  139.         unsigned ib_maskcolor    : 4;
  140.         unsigned ib_datacolor    : 4;
  141.         unsigned character        : 8;
  142.     } i_color;
  143.     char title_text[18];        /* title for CPX entry */
  144.     struct {                    /* tedinfo field for colour */
  145.         unsigned te_framecolor        : 4;
  146.         unsigned te_textcolor        : 4;
  147.         unsigned te_textmode        : 1;
  148.         unsigned te_fillpattern        : 3;
  149.         unsigned te_interiorcolor    : 4;
  150.     } t_color;
  151.     char buffer[64];            /* buffer for RAM storage */
  152.     char reserved[306];            /* reserved for expansion */
  153. } CPXHEAD;
  154.  
  155. #ifdef __cplusplus
  156. }
  157. #endif
  158. #endif    /* CPX_H */
  159.